package com.island.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.island.model.Role;
import com.pollexsoft.base.dao.BaseHibernateDao;

@Repository
public class RoleDao extends  BaseHibernateDao<Role, java.lang.String> {

	/**
	 * 查询全部角色
	 * @return
	 */
	public List<Role> findAll(){
		return find("from Role", new Object[]{});
	}
	
	/**
	 * 新建一个角色
	 * @param Role
	 */
	public void insertRole(Role role){
		this.insert(role);
	}
	
	/**
	 * 根据ID删除
	 * @param id
	 */
	public void delRole(int id){
		this.delete("delete from Role where roleID=?", id);
	}
	
	/**
	 * 修改角色信息
	 * @param Role
	 */
	public void updateRole(Role role){
		this.update(role);
	}
}
